using ASP;
using HoWave.Common;
using HoWave.Web;
using HoWave.Web.Admin;
using System;
using System.Data;
using System.Web.Profile;
using System.Web.SessionState;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
public class HL_Admin_Admin_ShopProductEdit : Admin, IRequiresSessionState
{
	protected RadioButtonList RadioButtonList_ProductType;
	protected Label ClassName;
	protected Literal setclass;
	protected HiddenField ClassID;
	protected TextBox ProductName;
	protected TextBox KeyWord;
	protected FileUpload FileUpload1;
	protected Image ProductImg;
	protected RadioButtonList proudct_video_type;
	protected TextBox Product_VideoUrl;
	protected RegularExpressionValidator RegularExpressionValidator1;
	protected FileUpload FileUploadVideo;
	protected Literal UploadVideoTips;
	protected HtmlTableRow upload_video_tr;
	protected TextBox ProductDescripe;
	protected TextBox MarketPrice;
	protected TextBox StandPrice;
	protected RegularExpressionValidator revStandPrice;
	protected RadioButtonList userMemberCard;
	protected TextBox AuctionPrice;
	protected RegularExpressionValidator revAuctionPrice;
	protected TextBox AuctionAddPrice;
	protected RegularExpressionValidator revAuctionAddPrice;
	protected TextBox OriginallyPrice;
	protected RegularExpressionValidator revOriginallyPrice;
	protected DropDownList DropTeamNum;
	protected Literal TeamName5;
	protected TextBox TeamNumber5;
	protected TextBox TeamPrice5;
	protected Literal TeamName4;
	protected TextBox TeamNumber4;
	protected TextBox TeamPrice4;
	protected Literal TeamName3;
	protected TextBox TeamNumber3;
	protected TextBox TeamPrice3;
	protected Literal TeamName2;
	protected TextBox TeamNumber2;
	protected TextBox TeamPrice2;
	protected Literal TeamName1;
	protected TextBox TeamNumber1;
	protected TextBox TeamPrice1;
	protected TextBox OrderMoneyPercent;
	protected Label TeamCount_Error;
	protected TextBox TxtPuint;
	protected TextBox ProductStock;
	protected RequiredFieldValidator rfv3;
	protected RangeValidator rav_2;
	protected RadioButtonList ProductStandard;
	protected Shop_UserControls_HowaveProvinceCity ProvinceCity;
	protected RadioButtonList NeedInvoice;
	protected TextBox TxtTaxRate;
	protected RequiredFieldValidator RequiredFieldValidator1;
	protected RangeValidator RangeValidator1;
	protected RadioButtonList Guarantee;
	protected CheckBoxList CheckBoxList_OnlinePayType;
	protected RadioButtonList Radio_DeliverPayType;
	protected RadioButtonList CheckBoxList_DeliverType;
	protected RadioButtonList PromoteSet;
	protected TextBox TxtDiscount;
	protected RequiredFieldValidator rfv4;
	protected RangeValidator rav_1;
	protected TextBox TxtPresentExp;
	protected RequiredFieldValidator rfv_5;
	protected RangeValidator rav_3;
	protected TextBox TxtPresentPoint;
	protected RequiredFieldValidator rfv_6;
	protected RangeValidator rav_18;
	protected TextBox TxtPresentMoney;
	protected RequiredFieldValidator rfv_7;
	protected RangeValidator rav_4;
	protected TextBox TxtDiscount1;
	protected RequiredFieldValidator rfv_8;
	protected RangeValidator rav_6;
	protected TextBox TxtPresentExp1;
	protected RequiredFieldValidator rfv_9;
	protected RangeValidator rav_5;
	protected TextBox TxtPresentPoint1;
	protected RequiredFieldValidator rfv_10;
	protected RangeValidator rav_7;
	protected TextBox TxtPresentMoney1;
	protected RequiredFieldValidator rfv_11;
	protected RangeValidator rav_8;
	protected TextBox TxtDiscount2;
	protected RequiredFieldValidator rfv_12;
	protected RangeValidator rav_10;
	protected TextBox TxtPresentExp2;
	protected RequiredFieldValidator rfv_13;
	protected RangeValidator rav_11;
	protected TextBox TxtPresentPoint2;
	protected RequiredFieldValidator rfv_14;
	protected RangeValidator rav_12;
	protected TextBox TxtPresentMoney2;
	protected RequiredFieldValidator rfv_15;
	protected RangeValidator rav_9;
	protected TextBox TxtDiscount3;
	protected RequiredFieldValidator rfv_16;
	protected RangeValidator rav_14;
	protected TextBox TxtPresentExp3;
	protected RequiredFieldValidator Rq7;
	protected RangeValidator Rg15;
	protected TextBox TxtPresentPoint3;
	protected RequiredFieldValidator Rq18;
	protected RangeValidator Rg16;
	protected TextBox TxtPresentMoney3;
	protected RequiredFieldValidator Rq19;
	protected RangeValidator Rg13;
	protected DropDownList ValidDay;
	protected RadioButtonList ProductPublishTime;
	protected TextBox PublishStartDay;
	protected DropDownList PublishStartHour;
	protected DropDownList PublishStartMin;
	protected CheckBox AutoPostBack;
	protected DropDownList TemplateID;
	protected new DropDownList SkinID;
	protected CheckBox IsElite;
	protected TextBox UserRemark;
	protected TextBox SELLID;
	protected RegularExpressionValidator RegularExpressionValidator2;
	protected TextBox SHOPID;
	protected RegularExpressionValidator RegularExpressionValidator3;
	protected TextBox NUMORDER;
	protected RegularExpressionValidator RegularExpressionValidator10;
	protected TextBox NUMCOM;
	protected RegularExpressionValidator RegularExpressionValidator9;
	protected TextBox NUMCLICK;
	protected RegularExpressionValidator RegularExpressionValidator8;
	protected TextBox NUMBUY;
	protected RegularExpressionValidator RegularExpressionValidator4;
	protected TextBox NUMTURN;
	protected RegularExpressionValidator RegularExpressionValidator5;
	protected TextBox NUMTEM;
	protected RegularExpressionValidator RegularExpressionValidator7;
	protected TextBox NUMCSS;
	protected RegularExpressionValidator RegularExpressionValidator6;
	protected Button Button_Submit;
	private int ProductID = 0;
	private string Cs_TeamName = string.Empty;
	private DataRow ProductInfo;
	private DataRow shopconfig = new ShopConfigBll().GetConfig().Rows[0];
	private int UserID;
	protected DefaultProfile Profile
	{
		get
		{
			return (DefaultProfile)this.Context.Profile;
		}
	}
	protected global_asax ApplicationInstance
	{
		get
		{
			return (global_asax)this.Context.ApplicationInstance;
		}
	}
	protected void Page_Load(object sender, EventArgs e)
	{
		if (!base.admin.CheckAdminPower(20))
		{
			base.WriteLog("View", Language.GetAdminMsg("Log/Access", "0"), "Product");
			base.WriteRightErrMsg();
		}
		this.ProductID = Fetch.GetID("ID");
		if (this.ProductID <= 0)
		{
			this.WriteErrMsg("", Language.GetAdminMsg("Common/LostParam"), "");
		}
		Shop_Product shop_Product = new Shop_Product(this.conn);
		DataTable productByProductID = shop_Product.GetProductByProductID(Fetch.GetID("ID"));
		if (productByProductID.Rows.Count > 0)
		{
			this.ProductInfo = productByProductID.Rows[0];
		}
		else
		{
			this.WriteErrMsg("", Language.GetMemberMsg("Shop/Product/CantEdit", new string[0]), "Member/Index.aspx");
		}
		if (!base.IsPostBack)
		{
			this.Initpage();
			this.BindDeliverType();
			this.BindPayType();
		}
		this.PublishStartDay.Attributes.Add("onClick", string.Concat(new string[]
		{
			"show_cele_date(",
			this.PublishStartDay.UniqueID,
			",'','',",
			this.PublishStartDay.UniqueID,
			");"
		}));
		this.FileUpload1.Attributes.Add("onchange", "previewImg(this.value);");
	}
	protected void Initpage()
	{
		this.SELLID.Text = this.ProductInfo["SalerID"].ToString();
		this.UserID = Convert.ToInt32(this.ProductInfo["SalerID"]);
		this.SHOPID.Text = this.ProductInfo["ShopID"].ToString();
		this.NUMORDER.Text = this.ProductInfo["OrderNum"].ToString();
		this.NUMCOM.Text = this.ProductInfo["CommentCount"].ToString();
		this.NUMCLICK.Text = this.ProductInfo["Hits"].ToString();
		this.NUMBUY.Text = this.ProductInfo["BuyTimes"].ToString();
		this.NUMTURN.Text = this.ProductInfo["OrderBy"].ToString();
		this.NUMTEM.Text = this.ProductInfo["TemplateID"].ToString();
		this.NUMCSS.Text = this.ProductInfo["SkinID"].ToString();
		this.RadioButtonList_ProductType.Items.FindByValue(this.ProductInfo["ProductType"].ToString()).Selected = true;
		this.ClassID.Value = this.ProductInfo["ClassID"].ToString();
		this.setclass.Text = string.Concat(new string[]
		{
			" <script type=\"text/javascript\">setTimeout('setClassName(\\'",
			this.ProductInfo["ClassID"].ToString(),
			"\\',\\'",
			this.ClassName.ClientID,
			"\\',\\'",
			this.ClassID.ClientID,
			"\\')',10);</script>"
		});
		this.ProductName.Text = this.ProductInfo["ProductName"].ToString();
		this.KeyWord.Text = this.ProductInfo["Keyword"].ToString();
		this.ProductDescripe.Text = (string)this.ProductInfo["ProductIntro"];
		if (this.ProductInfo["ProductSmallImageUrl"].ToString() != "")
		{
			this.ProductImg.ImageUrl = "../UpLoadFile/ShopPic/" + this.ProductInfo["ProductSmallImageUrl"].ToString();
		}
		else
		{
			this.ProductImg.ImageUrl = "../images/nopicture.gif";
		}
		this.MarketPrice.Text = this.ProductInfo["MemberPrice"].ToString();
		string text = this.ProductInfo["UploadFiles"].ToString();
		if (!string.IsNullOrEmpty(text) && !text.ToLower().Contains("http"))
		{
			text = this.config["SiteUrl"].ToString() + "UpLoadFile/ShopVideo/" + text;
		}
		this.Product_VideoUrl.Text = text;
		this.StandPrice.Text = this.ProductInfo["StandPrice"].ToString();
		this.TxtPuint.Text = this.ProductInfo["PUnit"].ToString();
		this.ProductStock.Text = this.ProductInfo["Stocks"].ToString();
		if (this.ProductInfo["ProductStandard"].ToString() == "1")
		{
			this.ProductStandard.Items[0].Selected = true;
			this.ProductStandard.Items[1].Selected = false;
		}
		else
		{
			this.ProductStandard.Items[1].Selected = true;
			this.ProductStandard.Items[0].Selected = false;
		}
		if ((bool)this.ProductInfo["NeedInvoice"])
		{
			this.NeedInvoice.Items[0].Selected = true;
			this.NeedInvoice.Items[1].Selected = false;
		}
		else
		{
			this.NeedInvoice.Items[1].Selected = true;
			this.NeedInvoice.Items[0].Selected = false;
		}
		if ((bool)this.ProductInfo["Guarantee"])
		{
			this.Guarantee.Items[0].Selected = true;
			this.Guarantee.Items[1].Selected = false;
		}
		else
		{
			this.Guarantee.Items[1].Selected = true;
			this.Guarantee.Items[0].Selected = false;
		}
		if ((bool)this.ProductInfo["IsElite"])
		{
			this.IsElite.Checked = true;
		}
		else
		{
			this.IsElite.Checked = false;
		}
		this.UserRemark.Text = this.ProductInfo["Remark"].ToString();
		if ((bool)this.ProductInfo["AutoPostBack"])
		{
			this.AutoPostBack.Checked = false;
		}
		else
		{
			this.AutoPostBack.Checked = true;
		}
		if (this.shopconfig["Showstandprice"].ToString() != "1")
		{
			for (int i = 0; i < this.RadioButtonList_ProductType.Items.Count; i++)
			{
				if (this.RadioButtonList_ProductType.Items[i].Value == "1")
				{
					this.RadioButtonList_ProductType.Items.Remove(this.RadioButtonList_ProductType.Items[i]);
				}
			}
		}
		if (this.shopconfig["ShowAction"].ToString() != "1")
		{
			for (int i = 0; i < this.RadioButtonList_ProductType.Items.Count; i++)
			{
				if (this.RadioButtonList_ProductType.Items[i].Value == "2")
				{
					this.RadioButtonList_ProductType.Items.Remove(this.RadioButtonList_ProductType.Items[i]);
				}
			}
		}
		if (this.shopconfig["ShowTeam"].ToString() != "1")
		{
			for (int i = 0; i < this.RadioButtonList_ProductType.Items.Count; i++)
			{
				if (this.RadioButtonList_ProductType.Items[i].Value == "3")
				{
					this.RadioButtonList_ProductType.Items.Remove(this.RadioButtonList_ProductType.Items[i]);
				}
			}
		}
		this.TeamName1.Text = this.shopconfig["Team1Name"].ToString();
		this.TeamName2.Text = this.shopconfig["Team2Name"].ToString();
		this.TeamName3.Text = this.shopconfig["Team3Name"].ToString();
		this.TeamName4.Text = this.shopconfig["Team4Name"].ToString();
		this.TeamName5.Text = this.shopconfig["Team5Name"].ToString();
		int num = Convert.ToInt32(this.shopconfig["TeamSet"]);
		for (int i = 1; i < num + 1; i++)
		{
			ListItem item = new ListItem(i.ToString(), i.ToString());
			this.DropTeamNum.Items.Add(item);
		}
		string text2 = this.shopconfig["SaleDay"].ToString();
		if (text2.Contains("|"))
		{
			string[] array = text2.Split(new char[]
			{
				'|'
			});
			for (int i = 0; i < array.Length; i++)
			{
				this.ValidDay.Items.Add(array[i]);
			}
		}
		this.ValidDay.SelectedValue = this.ProductInfo["ValidDay"].ToString();
		this.ProvinceCity.SelectedProvince = this.ProductInfo["Province"].ToString();
		this.ProvinceCity.SelectedCity = this.ProductInfo["City"].ToString();
		this.BindDrList(this.PublishStartHour, ((DateTime)this.ProductInfo["BeginDate"]).Hour.ToString());
		this.BindDrList(this.PublishStartMin, ((DateTime)this.ProductInfo["BeginDate"]).Minute.ToString());
		this.PublishStartDay.Text = ((DateTime)this.ProductInfo["BeginDate"]).ToShortDateString();
	}
	private void BindDrList(DropDownList PublishStartHour, string p)
	{
		foreach (ListItem listItem in PublishStartHour.Items)
		{
			if (listItem.Value.Equals(p))
			{
				listItem.Selected = true;
				break;
			}
		}
	}
	protected void BindDeliverType()
	{
		Shop_DeliverType shop_DeliverType = new Shop_DeliverType(this.conn);
		DataTable deliverTypeByUserIDTypeIDStatus = shop_DeliverType.GetDeliverTypeByUserIDTypeIDStatus(this.UserID, -1, 0);
		if (deliverTypeByUserIDTypeIDStatus.Rows.Count > 0)
		{
			bool flag = false;
			this.CheckBoxList_DeliverType.DataSource = deliverTypeByUserIDTypeIDStatus;
			this.CheckBoxList_DeliverType.DataTextField = "typename";
			this.CheckBoxList_DeliverType.DataValueField = "typeid";
			this.CheckBoxList_DeliverType.DataBind();
			foreach (ListItem listItem in this.CheckBoxList_DeliverType.Items)
			{
				if (listItem.Value.Equals(this.ProductInfo["DeliverType"]))
				{
					listItem.Selected = true;
					flag = true;
					break;
				}
			}
			if (!flag)
			{
				this.CheckBoxList_DeliverType.Items[0].Selected = true;
			}
		}
	}
	protected void BindPayType()
	{
		Shop_PayType shop_PayType = new Shop_PayType(this.conn);
		DataTable unDisabledPayTypeByUserID = shop_PayType.GetUnDisabledPayTypeByUserID(this.UserID);
		if (unDisabledPayTypeByUserID.Rows.Count > 0)
		{
			this.CheckBoxList_OnlinePayType.DataSource = unDisabledPayTypeByUserID;
			this.CheckBoxList_OnlinePayType.DataTextField = "typename";
			this.CheckBoxList_OnlinePayType.DataValueField = "typeid";
			this.CheckBoxList_OnlinePayType.DataBind();
			foreach (ListItem listItem in this.CheckBoxList_OnlinePayType.Items)
			{
				listItem.Attributes.Add("onclick", "mustcheck(this);");
				if (this.ProductInfo["PayType"].ToString().Contains(listItem.Value))
				{
					listItem.Selected = true;
				}
			}
		}
	}
	protected void Button_Submit_Click(object sender, EventArgs e)
	{
		if (this.CheckInput())
		{
			string text = string.Empty;
			text = this.UploadPicMakeSamllPic();
			if (string.IsNullOrEmpty(text))
			{
				text = this.ProductInfo["ProductSmallImageUrl"].ToString();
			}
			string text2 = this.ProductInfo["UploadFiles"].ToString();
			if (!string.IsNullOrEmpty(text2) && !text2.ToLower().Contains("http"))
			{
				text2 = this.config["SiteUrl"].ToString() + "UpLoadFile/ShopVideo/" + text2;
			}
			string text3 = string.Empty;
			if (this.proudct_video_type.SelectedValue == "url")
			{
				text3 = this.Product_VideoUrl.Text;
				if (text2.Trim() == text3.Trim())
				{
					text3 = this.ProductInfo["UploadFiles"].ToString();
				}
			}
			else
			{
				if (this.proudct_video_type.SelectedValue == "file")
				{
					text3 = this.UploadVideo();
				}
				else
				{
					if (this.proudct_video_type.SelectedValue == "del")
					{
						this.FileUploadVideo.Dispose();
						this.FileUploadVideo = null;
						text3 = this.UploadVideo();
					}
				}
			}
			Shop_Product shop_Product = new Shop_Product(this.conn);
			DateTime value = DateTime.Now;
			if (this.ProductPublishTime.SelectedValue == "2")
			{
				value = Convert.ToDateTime(string.Concat(new string[]
				{
					this.PublishStartDay.Text,
					" ",
					this.PublishStartHour.SelectedValue,
					":",
					this.PublishStartHour.SelectedValue,
					":00"
				}));
			}
			DateTime value2 = value.AddDays((double)Convert.ToInt32(this.ValidDay.SelectedValue));
			bool value3 = true;
			if (this.ProductPublishTime.SelectedValue == "0")
			{
				value3 = false;
			}
			decimal num = Text.ToDecimal(this.StandPrice.Text);
			if (this.RadioButtonList_ProductType.SelectedValue == "1")
			{
				num = Text.ToDecimal(this.StandPrice.Text);
			}
			else
			{
				if (this.RadioButtonList_ProductType.SelectedValue == "2")
				{
					num = Text.ToDecimal(this.AuctionPrice.Text);
				}
				else
				{
					if (this.RadioButtonList_ProductType.SelectedValue == "3")
					{
						switch (Text.ToInt32(this.DropTeamNum.SelectedValue))
						{
						case 1:
							num = Text.ToDecimal(this.TeamNumber5.Text);
							break;
						case 2:
							num = Text.ToDecimal(this.TeamNumber4.Text);
							break;
						case 3:
							num = Text.ToDecimal(this.TeamNumber3.Text);
							break;
						case 4:
							num = Text.ToDecimal(this.TeamNumber2.Text);
							break;
						case 5:
							num = Text.ToDecimal(this.TeamNumber1.Text);
							break;
						}
					}
				}
			}
			bool flag = shop_Product.UpdateProduct((int)this.ProductInfo["ProductID"], this.ProvinceCity.SelectedText, new int?(Text.ToInt32(this.ClassID.Value)), this.ProductName.Text, this.ProductStandard.Text, this.ProductDescripe.Text, text, this.RadioButtonList_ProductType.SelectedValue, new decimal?(Text.ToDecimal(this.StandPrice.Text)), new decimal?(Text.ToDecimal(this.AuctionPrice.Text)), new decimal?(Text.ToDecimal(this.AuctionAddPrice.Text)), new decimal?(Text.ToDecimal(this.MarketPrice.Text)), this.Cs_TeamName, new int?(Text.ToInt32(this.DropTeamNum.SelectedValue)), new decimal?(Text.ToDecimal(this.TeamPrice1.Text)), new decimal?(Text.ToDecimal(this.OrderMoneyPercent.Text)), new int?(Text.ToInt32(this.TeamNumber1.Text)), new decimal?(Text.ToDecimal(this.TeamPrice2.Text)), new int?(Text.ToInt32(this.TeamNumber2.Text)), new decimal?(Text.ToDecimal(this.TeamPrice3.Text)), new int?(Text.ToInt32(this.TeamNumber3.Text)), new decimal?(Text.ToDecimal(this.TeamPrice4.Text)), new int?(Text.ToInt32(this.TeamNumber4.Text)), new decimal?(Text.ToDecimal(this.TeamPrice5.Text)), new int?(Text.ToInt32(this.TeamNumber5.Text)), new bool?(this.IsElite.Checked), new int?(Text.ToInt32(this.ProductStock.Text)), new bool?(true), this.CheckBoxList_DeliverType.SelectedValue, "", new bool?(Convert.ToBoolean(this.NeedInvoice.SelectedValue)), new bool?(Convert.ToBoolean(this.Guarantee.SelectedValue)), new int?(Text.ToInt32(this.ValidDay.SelectedValue)), new bool?(this.AutoPostBack.Checked), this.UserRemark.Text, new int?(Text.ToInt32(this.CheckBoxList_DeliverType.SelectedValue)), this.CheckBoxList_OnlinePayType.SelectedValue, this.CheckBoxList_OnlinePayType.SelectedValue, new int?(0), new int?(0), new int?(Text.ToInt32(this.TxtDiscount.Text)), new int?(Text.ToInt32(this.TxtPresentExp.Text)), new int?(Text.ToInt32(this.TxtPresentPoint.Text)), new decimal?(Text.ToDecimal(this.TxtPresentMoney.Text)), new int?(Text.ToInt32(this.TxtDiscount1.Text)), new int?(Text.ToInt32(this.TxtPresentExp1.Text)), new int?(Text.ToInt32(this.TxtPresentPoint1.Text)), new decimal?(Text.ToDecimal(this.TxtPresentMoney1.Text)), new int?(Text.ToInt32(this.TxtDiscount2.Text)), new int?(Text.ToInt32(this.TxtPresentExp2.Text)), new int?(Text.ToInt32(this.TxtPresentPoint2.Text)), new decimal?(Text.ToDecimal(this.TxtPresentMoney2.Text)), new int?(Text.ToInt32(this.TxtDiscount3.Text)), new int?(Text.ToInt32(this.TxtPresentExp3.Text)), new int?(Text.ToInt32(this.TxtPresentPoint3.Text)), new decimal?(Text.ToDecimal(this.TxtPresentMoney3.Text)), this.TxtPuint.Text, this.ProductPublishTime.SelectedValue, text, new decimal?(Text.ToDecimal(this.TxtTaxRate.Text)), new bool?(value3), text3, "", this.KeyWord.Text, new DateTime?(value), new DateTime?(value2), this.ProvinceCity.SelectedProvince, this.ProvinceCity.SelectedCity, this.NUMTEM.Text, this.NUMCSS.Text, this.NUMTURN.Text, this.NUMBUY.Text, this.NUMCLICK.Text, this.NUMCOM.Text, this.NUMORDER.Text, this.SHOPID.Text, this.SELLID.Text, this.ProductInfo["Color"].ToString(), this.ProductInfo["Size"].ToString(), this.ProductInfo["Attributes"].ToString(), "", false);
			this.WriteSuccessMsg("", Language.Get("Shop/Product/OKEdit"), "");
		}
	}
	private string UploadPicMakeSamllPic()
	{
		UpLoadFile upLoadFile = new UpLoadFile();
		return upLoadFile.UploadPic(this.FileUpload1, this.config, "../UpLoadFile/ShopPic/" + this.ProductInfo["ProductSmallImageUrl"].ToString());
	}
	private string UploadVideo()
	{
		UpLoadFile upLoadFile = new UpLoadFile();
		return upLoadFile.UploadVideo(this.FileUploadVideo, this.config, "../UpLoadFile/ShopVideo/" + this.ProductInfo["UploadFiles"].ToString());
	}
	public bool CheckInput()
	{
		string text = string.Empty;
		string selectedValue = this.RadioButtonList_ProductType.SelectedValue;
		decimal num = 0m;
		if (this.ProvinceCity.SelectedText == string.Empty)
		{
			text += Language.Get("Shop/Product/ProductNameNull");
		}
		if (this.TxtPuint.Text == string.Empty)
		{
			text += Language.Get("Shop/Product/PuintNull");
		}
		if (selectedValue == string.Empty)
		{
			text += Language.Get("Shop/Product/ClassNull");
		}
		if (!Text.IsNumber(this.ProductStock.Text))
		{
			text += Language.Get("Shop/Product/Stock");
		}
		if (selectedValue == "2")
		{
			try
			{
				Convert.ToDecimal(this.AuctionPrice.Text);
				Convert.ToDecimal(this.AuctionAddPrice.Text);
			}
			catch
			{
				text += Language.Get("Shop/Product/AuctionPriceErr");
			}
		}
		else
		{
			if (selectedValue == "3")
			{
				if (this.TeamName1.Text.Trim() == "" || this.TeamName2.Text.Trim() == "" || this.TeamName3.Text.Trim() == "" || this.TeamName4.Text.Trim() == "" || this.TeamName5.Text.Trim() == "")
				{
					text += Language.Get("Shop/Product/TeamNameNull");
				}
				else
				{
					this.Cs_TeamName = string.Concat(new string[]
					{
						this.TeamName1.Text,
						",",
						this.TeamName2.Text,
						",",
						this.TeamName3.Text,
						",",
						this.TeamName4.Text,
						",",
						this.TeamName5.Text
					});
				}
				try
				{
					num = Convert.ToDecimal(this.OriginallyPrice.Text);
					if (num <= 0m)
					{
						text += Language.Get("Shop/Product/OriginallyPriceNull");
					}
				}
				catch
				{
					text = (text ?? "");
					Language.Get("Shop/Product/OriginallyPriceErr");
				}
				try
				{
					Convert.ToDecimal(this.TeamPrice1.Text);
				}
				catch
				{
					text += Language.Get("Shop/Product/TeamPriceErr", this.TeamName1.Text);
				}
				try
				{
					Convert.ToInt32(this.TeamNumber1.Text);
				}
				catch
				{
					text += Language.Get("Shop/Product/TeamNumberErr", this.TeamName1.Text);
				}
				try
				{
					Convert.ToDecimal(this.OrderMoneyPercent.Text);
				}
				catch
				{
					text += Language.Get("Shop/Product/OrderMoneyPercentErr");
				}
				try
				{
					Convert.ToDecimal(this.TeamPrice2.Text);
				}
				catch
				{
					text += Language.Get("Shop/Product/TeamPriceErr", this.TeamPrice2.Text);
				}
				try
				{
					Convert.ToInt32(this.TeamNumber2.Text);
				}
				catch
				{
					text += Language.Get("Shop/Product/TeamNumberErr", this.TeamName2.Text);
				}
				try
				{
					Convert.ToDecimal(this.TeamPrice3.Text);
				}
				catch
				{
					text += Language.Get("Shop/Product/TeamPriceErr", this.TeamPrice3.Text);
				}
				try
				{
					Convert.ToInt32(this.TeamNumber3.Text);
				}
				catch
				{
					text += Language.Get("Shop/Product/TeamNumberErr", this.TeamNumber3.Text);
				}
				try
				{
					Convert.ToDecimal(this.TeamPrice4.Text);
				}
				catch
				{
					text += Language.Get("Shop/Product/TeamPriceErr", this.TeamPrice4.Text);
				}
				try
				{
					Convert.ToInt32(this.TeamNumber4.Text);
				}
				catch
				{
					text += Language.Get("Shop/Product/TeamNumberErr", this.TeamNumber4.Text);
				}
				try
				{
					Convert.ToDecimal(this.TeamPrice5.Text);
				}
				catch
				{
					text += Language.Get("Shop/Product/TeamPriceErr", this.TeamPrice5.Text);
				}
				try
				{
					Convert.ToInt32(this.TeamNumber5.Text);
				}
				catch
				{
					text += Language.Get("Shop/Product/TeamNumberErr", this.TeamNumber5.Text);
				}
				if (Text.ToDecimal(this.TeamNumber5.Text) <= 1m)
				{
					text += Language.Get("Shop/Product/TeamNumberErr", this.TeamNumber5.Text);
				}
				string selectedValue2 = this.DropTeamNum.SelectedValue;
				if (selectedValue2 != null)
				{
					if (!(selectedValue2 == "1"))
					{
						if (!(selectedValue2 == "2"))
						{
							if (!(selectedValue2 == "3"))
							{
								if (!(selectedValue2 == "4"))
								{
									if (selectedValue2 == "5")
									{
										if (Text.ToInt32(this.TeamNumber5.Text) <= Text.ToInt32(this.TeamNumber4.Text) || Text.ToInt32(this.TeamNumber4.Text) <= Text.ToInt32(this.TeamNumber3.Text) || Text.ToInt32(this.TeamNumber3.Text) <= Text.ToInt32(this.TeamNumber2.Text) || Text.ToInt32(this.TeamNumber2.Text) <= Text.ToInt32(this.TeamNumber1.Text))
										{
											text += Language.Get("Shop/Product/TeamNumberErr", "");
										}
										if (Text.ToDecimal(this.TeamPrice5.Text) >= Text.ToDecimal(this.TeamPrice4.Text) || Text.ToDecimal(this.TeamPrice4.Text) >= Text.ToDecimal(this.TeamPrice3.Text) || Text.ToDecimal(this.TeamPrice3.Text) >= Text.ToDecimal(this.TeamPrice2.Text) || Text.ToDecimal(this.TeamPrice2.Text) >= Text.ToDecimal(this.TeamPrice1.Text) || Text.ToDecimal(this.TeamPrice1.Text) >= num)
										{
											text += Language.Get("Shop/Product/TeamPriceErr", "");
										}
									}
								}
								else
								{
									if (Text.ToInt32(this.TeamNumber5.Text) <= Text.ToInt32(this.TeamNumber4.Text) || Text.ToInt32(this.TeamNumber4.Text) <= Text.ToInt32(this.TeamNumber3.Text) || Text.ToInt32(this.TeamNumber3.Text) <= Text.ToInt32(this.TeamNumber2.Text))
									{
										text += Language.Get("Shop/Product/TeamNumberErr", "");
									}
									if (Text.ToDecimal(this.TeamPrice5.Text) >= Text.ToDecimal(this.TeamPrice4.Text) || Text.ToDecimal(this.TeamPrice4.Text) >= Text.ToDecimal(this.TeamPrice3.Text) || Text.ToDecimal(this.TeamPrice3.Text) >= Text.ToDecimal(this.TeamPrice2.Text) || Text.ToDecimal(this.TeamPrice2.Text) >= num)
									{
										text += Language.Get("Shop/Product/TeamPriceErr", "");
									}
								}
							}
							else
							{
								if (Text.ToInt32(this.TeamNumber5.Text) <= Text.ToInt32(this.TeamNumber4.Text) || Text.ToInt32(this.TeamNumber4.Text) <= Text.ToInt32(this.TeamNumber3.Text))
								{
									text += Language.Get("Shop/Product/TeamNumberErr", "");
								}
								if (Text.ToDecimal(this.TeamPrice5.Text) >= Text.ToDecimal(this.TeamPrice4.Text) || Text.ToDecimal(this.TeamPrice4.Text) >= Text.ToDecimal(this.TeamPrice3.Text) || Text.ToDecimal(this.TeamPrice3.Text) >= num)
								{
									text += Language.Get("Shop/Product/TeamPriceErr", "");
								}
							}
						}
						else
						{
							if (Text.ToInt32(this.TeamNumber5.Text) <= Text.ToInt32(this.TeamNumber4.Text))
							{
								text += Language.Get("Shop/Product/TeamPriceErr", this.TeamPrice5.Text);
							}
							if (Text.ToDecimal(this.TeamPrice5.Text) >= Text.ToDecimal(this.TeamPrice4.Text) || Text.ToDecimal(this.TeamPrice4.Text) >= num)
							{
								text += Language.Get("Shop/Product/TeamPriceErr", "");
							}
						}
					}
					else
					{
						if (Text.ToInt32(this.TeamPrice5.Text) > num)
						{
							text += Language.Get("Shop/Product/TeamPriceErr", this.TeamPrice5.Text);
						}
					}
				}
			}
			else
			{
				try
				{
					Convert.ToDecimal(this.StandPrice.Text);
				}
				catch
				{
					text += Language.Get("Shop/Product/StandPriceErr");
				}
			}
		}
		bool result;
		if (text.Trim().Length > 0)
		{
			this.WriteErrMsg("", text, "");
			result = false;
		}
		else
		{
			result = true;
		}
		return result;
	}
}
